#ifndef __GL_BUTTON_H__
#define __GL_BUTTON_H__


#include "GLui.h"
#include "TextObject.h"
#include "TTFFont.h"

//provide a function which will fill these values for button.
typedef void (*UIInputHandler)(int &x, int &y, bool &clicked);

//callback function for handling button click event
typedef void (*ClickHandler)();

class GLButton:public GLRect
{
    GLRect *sRect;
    TextObject *bText;
    UIInputHandler bInputHandler;
    ClickHandler bPressHandler;
    bool calledEventHandler;

    public:
        GLButton(int x, int y, UIInputHandler bIn=NULL, ClickHandler bPress = NULL, const char *str = (const char *)"Button", int w = 100, int h = 30);
        ~GLButton();
        void setText(char *str);

        //function to draw the button and call the input handler
        void show();
};


#endif //__GL_BUTTON_H__
